package org.zephy.th.base;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

public class CallableTest implements Callable<String> {
    @Override
    public String call() throws Exception {
        System.out.println("实现Callable:");
        return null;
    }

    public static void main(String[] args) {
        CallableTest test=new CallableTest();
        FutureTask task=new FutureTask(test);
        new Thread(task,"A").start();
        System.out.println(new Thread(task).getName());
        new Thread(new FutureTask<String>(new CallableTest()),"B").start();
    }
}
